﻿<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="ManagementUsers.aspx.cs" 
    Inherits="GMAC.ReportingSystem.Paginas.ManagementUsers" Theme="Theme" EnableTheming="true"
    EnableEventValidation="false" %>


<%@ Register assembly="FrameworkManapro.WebUI" namespace="FrameworkManapro.WebUI" tagprefix="fwm" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>

    <script type="text/javascript" src="../Scripts/Validations.js"></script>

    <script type="text/javascript" src="../Scripts/CheckFramesAndRedirect.js"></script>

    <script type="text/javascript">
        function ExpandPanel()
        {
            var pnlDetailsExtender = $find("pnlDetailsExtender");
            var pnlSearchExtender = $find("pnlSearchExtender");
            if (pnlDetailsExtender != null)
    
                pnlDetailsExtender.expandPanel();
            pnlSearchExtender.collapsePanel();
        }
        /***********************************************************************
        * Modified by:  Michelle A. González A.
        * Date:         04/08/2010
        * Description:  Added a userId parameter to the CheckLogin function.
        ************************************************************************/
        function CheckLogin() {

            var login = document.getElementById("txtLogin").value;
            var userId = document.getElementById("hfUserId").value;
            PageMethods.CheckLogin(login,userId, LoginSuccessful, LoginFailed);
        }
        function LoginSuccessful(result) {
            var hdfValidateLogin = document.getElementById("hdfValidateLogin");
            hdfValidateLogin.value = 0;
            var lblValidateLogin = document.getElementById("lblValidateLogin");
            lblValidateLogin.innerHTML = "";
        }
        function LoginFailed(error) {
            var hdfValidateLogin = document.getElementById("hdfValidateLogin");
            hdfValidateLogin.value = 1;
            if (hdfValidateLogin.value != 0) {
                var lblValidateLogin = document.getElementById("lblValidateLogin");
                var txtLogin = document.getElementById("txtLogin");
                lblValidateLogin.innerHTML = error.get_message()
                txtLogin.value = "";
                txtLogin.focus();
            }
        }
    </script>

</head>
<body class="TotalBody">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    </asp:ScriptManager>
    <div class="Contenedor" style = "padding-bottom: 10px; padding-top:10px;">
        <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; vertical-align: top">
            <tr>
                <td style="text-align: left">
                    <span class="FontArialPaddingLeft15 TitleFontBlue FontArialBoldCaps">&nbsp;Users</span>
                </td>
            </tr>
            <tr>
                <td align="center">
                    <div class="WindowHeightMain">
                        <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; vertical-align: top">
                            <tr>
                                <td class="TDSeparadorV" colspan="2">
                                </td>
                            </tr>
                            <tr class="SearchBackground" style="width: 100%">
                                <td class="TDBorder">
                                    <table cellpadding="0" cellspacing="0" border="0">
                                        <tr>
                                            <td style="padding-left: 10px; text-align: left; width: 100%">
                                                <span class="FontArialBoldCaps" style="font-size: 14px">Search Filter</span>
                                            </td>
                                            <td style="padding-right: 10px; text-align: right">
                                                <asp:ImageButton ID="imgCollapseSearch" ImageAlign="Middle" ImageUrl="~/App_Themes/Theme/Images/Images IE6/Minus.gif"
                                                    Width="25px" Height="25px" OnClientClick="return false;" runat="server" BorderWidth="0px" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:Panel ID="pnlSearch" runat="server" SkinID="pnlBusqueda" Height="89px">
                                        <table cellpadding="0" cellspacing="0" border="0" visible="false">
                                            <tr>
                                                <td>
                                                    <table cellpadding="0" cellspacing="0" border="0">
                                                        <tr style="padding-left: 10px">
                                                            <td style="padding-left: 5px" class="LabelRight12px TDLabelBackground">
                                                                User ID Number
                                                            </td>
                                                            <td class="TDTextBox">
                                                                <asp:TextBox ID="txtIdentitySearch" runat="server" MaxLength="10" SkinID="TextBox12px"
                                                                    TextMode="SingleLine" TabIndex="1"></asp:TextBox>
                                                                <cc1:FilteredTextBoxExtender ID="fteIdentitySearch" runat="server" TargetControlID="txtIdentitySearch"
                                                                    FilterType="Numbers">
                                                                </cc1:FilteredTextBoxExtender>
                                                            </td>
                                                        </tr>
                                                        <tr style="padding-left: 10px">
                                                            <td style="padding-left: 5px" class="LabelRight12px TDLabelBackground">
                                                                User Name
                                                            </td>
                                                            <td class="TDTextBox">
                                                                <asp:TextBox ID="txtNameSeach" runat="server" MaxLength="50" SkinID="TextBox12px"
                                                                    TextMode="SingleLine" TabIndex="2"></asp:TextBox>
                                                                    <cc1:FilteredTextBoxExtender ID="fteNameSearch" runat="server" TargetControlID="txtNameSeach" SkinID="filterText">
                                                                    </cc1:FilteredTextBoxExtender>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                                <td class="TDSeparadorH">
                                                </td>
                                                <td>
                                                    <table cellpadding="0" cellspacing="0" border="0">
                                                        <tr style="padding-left: 10px">
                                                            <td style="padding-left: 5px" class="LabelRight12px TDLabelBackground">
                                                                Login
                                                            </td>
                                                            <td class="TDTextBox">
                                                                <asp:TextBox ID="txtLoginSearch" runat="server" MaxLength="6" SkinID="TextBox12px"
                                                                    TextMode="SingleLine" TabIndex="3"></asp:TextBox>
                                                                <cc1:FilteredTextBoxExtender ID="filterLoginSearch" runat="server" SkinID="filterAlphanumeric"
                                                                    TargetControlID="txtLoginSearch">
                                                                </cc1:FilteredTextBoxExtender>
                                                            </td>
                                                            <td>
                                                            </td>
                                                        </tr>
                                                        <tr style="padding-left: 10px">
                                                            <td style="padding-left: 5px" class="LabelRight12px TDLabelBackground">
                                                                Role
                                                            </td>
                                                            <td class="TDTextBox">
                                                                <asp:DropDownList ID="ddlRoleSearch" runat="server" SkinID="ddl12px" TabIndex="4">
                                                                </asp:DropDownList>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                                <td id="Botones" style="vertical-align: middle">
                                                    <asp:ImageButton ID="imgBuscarReg" ImageAlign="Middle" ImageUrl="~/App_Themes/Theme/Images/Botones/Botones Reducidos/Ingles/b_Find.jpg"
                                                        Height="25px" runat="server" OnClick="imgBuscarReg_Click" CausesValidation="false" TabIndex="5" />
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                                    <cc1:CollapsiblePanelExtender ID="pnlSearch_Collapse" runat="server" TargetControlID="pnlSearch"
                                        BehaviorID="pnlSearchExtender" CollapsedImage="~/App_Themes/Theme/Images/Images IE6/Plus.gif"
                                        ExpandedImage="~/App_Themes/Theme/Images/Images IE6/Minus.gif" CollapseControlID="imgCollapseSearch"
                                        ExpandControlID="imgCollapseSearch" Collapsed="false" SuppressPostBack="false"
                                        ImageControlID="imgCollapseSearch">
                                    </cc1:CollapsiblePanelExtender>
                                </td>
                            </tr>
                            <tr>
                                <td class="TDSeparadorV" colspan="2">
                                </td>
                            </tr>
                            <tr class="SearchBackground" style="width: 100%">
                                <td class="TDBorder">
                                    <table cellpadding="0" cellspacing="0" border="0">
                                        <tr>
                                            <td style="padding-left: 10px; text-align: left; width: 100%">
                                                <span class="FontArialBoldCaps" style="font-size: 14px">Edit Fields</span>
                                            </td>
                                            <td style="padding-right: 10px; text-align: right">
                                                <asp:ImageButton ID="imgCollapseEdit" ImageAlign="Middle" ImageUrl="~/App_Themes/Theme/Images/Images IE6/Minus.gif"
                                                    Width="25px" Height="25px" runat="server" BorderWidth="0px" OnClientClick="return false;"
                                                    TabIndex="6" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:UpdatePanel ID="upDetails" runat="server" UpdateMode="Conditional">
                                        <Triggers>
                                            <asp:AsyncPostBackTrigger ControlID="btnModify" EventName="Click" />
                                        </Triggers>
                                        <ContentTemplate>
                                            <asp:Panel ID="pnlEdit" runat="server" SkinID="pnlBusqueda" Height="198px">
                                                <table cellpadding="0" cellspacing="0" border="0" visible="false">
                                                    <tr>
                                                        <td valign="top">
                                                            <table cellpadding="0" cellspacing="0" border="0">
                                                                <tr style="padding-left: 10px">
                                                                    <td style="padding-left: 5px" class="LabelRight12px TDLabelBackground">
                                                                        User ID Number </td>
                                                                    <td class="TDTextBox">
                                                                        <asp:TextBox ID="txtIdentity" runat="server" MaxLength="10" SkinID="TextBox12px"
                                                                            TextMode="SingleLine" TabIndex="7"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID="rfvIdentity" runat="server" ControlToValidate="txtIdentity"
                                                                            Display="Dynamic">*</asp:RequiredFieldValidator>
                                                                        <cc1:ValidatorCalloutExtender runat="server" ID="vceIdentity" TargetControlID="rfvIdentity">
                                                                        </cc1:ValidatorCalloutExtender>
                                                                        <cc1:FilteredTextBoxExtender ID="fteIdentity" runat="server" TargetControlID="txtIdentity"
                                                                            Enabled="True" FilterType="Numbers">
                                                                        </cc1:FilteredTextBoxExtender>
                                                                        <asp:HiddenField ID="hfUserId" runat="server" />
                                                                    </td>
                                                                </tr>
                                                                <tr style="padding-left: 10px">
                                                                    <td style="padding-left: 5px" class="LabelRight12px TDLabelBackground">
                                                                        First Name
                                                                    </td>
                                                                    <td class="TDTextBox">
                                                                        <asp:TextBox ID="txtFirstName" runat="server" MaxLength="25" SkinID="TextBox12px"
                                                                            TextMode="SingleLine" TabIndex="8"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID="rfvFirstName" ControlToValidate="txtFirstName" Display="Dynamic"
                                                                            runat="server">*</asp:RequiredFieldValidator>
                                                                        <cc1:ValidatorCalloutExtender ID="vceFirstName" runat="server" TargetControlID="rfvFirstName">
                                                                        </cc1:ValidatorCalloutExtender>
                                                                        <cc1:FilteredTextBoxExtender ID="fteFirstName" runat="server" TargetControlID="txtFirstName" SkinID="filterText"></cc1:FilteredTextBoxExtender>
                                                                    </td>
                                                                </tr>
                                                                <tr style="padding-left: 10px">
                                                                    <td class="LabelRight12px TDLabelBackground" style="padding-left: 5px">
                                                                        Last Name
                                                                    </td>
                                                                    <td class="TDTextBox">
                                                                        <asp:TextBox ID="txtLastName" runat="server" MaxLength="25" SkinID="TextBox12px"
                                                                            TabIndex="8"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID="rfvLastName" ControlToValidate="txtLastName" Display="Dynamic"
                                                                            runat="server">*</asp:RequiredFieldValidator>
                                                                        <cc1:ValidatorCalloutExtender ID="vceLastName" runat="server" TargetControlID="rfvLastName">
                                                                        </cc1:ValidatorCalloutExtender>
                                                                        <cc1:FilteredTextBoxExtender ID="fteLastName" runat="server" TargetControlID="txtLastName" SkinID="filterText">
                                                                        </cc1:FilteredTextBoxExtender>
                                                                    </td>
                                                                </tr>
                                                                <tr style="padding-left: 10px">
                                                                    <td class="LabelRight12px TDLabelBackground" style="padding-left: 5px">
                                                                        Department
                                                                    </td>
                                                                    <td class="TDTextBox">
                                                                        <asp:TextBox ID="txtDepartment" runat="server" MaxLength="20" SkinID="TextBox12px"
                                                                            TabIndex="9"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID="rfvDepartment" runat="server" ControlToValidate="txtDepartment"
                                                                            Display="Dynamic">*</asp:RequiredFieldValidator>
                                                                        <cc1:ValidatorCalloutExtender ID="vceDepartment" runat="server" TargetControlID="rfvDepartment">
                                                                        </cc1:ValidatorCalloutExtender>
                                                                        <cc1:FilteredTextBoxExtender ID="fteDepartmet" runat="server" TargetControlID="txtDepartment" SkinID="filterText">
                                                                        </cc1:FilteredTextBoxExtender>
                                                                    </td>
                                                                </tr>
                                                                <tr style="padding-left: 10px">
                                                                    <td class="LabelRight12px TDLabelBackground" style="padding-left: 5px">
                                                                        Email
                                                                    </td>
                                                                    <td class="TDTextBox">
                                                                        <asp:TextBox ID="txtEmail" runat="server" SkinID="TextBoxEmail12px" MaxLength="30"
                                                                            TabIndex="10"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID="rfvEmail" runat="server" ControlToValidate="txtEmail"
                                                                            Display="Dynamic">*</asp:RequiredFieldValidator>
                                                                        <asp:RegularExpressionValidator ID="revEmail" runat="server" ErrorMessage="Email format is invalid"
                                                                            ValidationExpression="^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$" ControlToValidate="txtEmail" Display="Dynamic">*</asp:RegularExpressionValidator>
                                                                        <cc1:ValidatorCalloutExtender ID="vceEmail" runat="server" TargetControlID="rfvEmail">
                                                                        </cc1:ValidatorCalloutExtender>
                                                                        <cc1:ValidatorCalloutExtender ID="vceEmail2" runat="server" TargetControlID="revEmail">
                                                                        </cc1:ValidatorCalloutExtender>
                                                                    </td>
                                                                </tr>
                                                                <tr style="padding-left: 10px">
                                                                    <td class="LabelRight12px TDLabelBackground" style="padding-left: 5px">
                                                                        &nbsp;
                                                                    </td>
                                                                    <td class="TDTextBox">
                                                                        &nbsp;
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                        <td class="TDSeparadorH">
                                                        </td>
                                                        <td>
                                                            <table cellpadding="0" cellspacing="0" border="0">
                                                                <tr style="padding-left: 10px">
                                                                    <td style="padding-left: 5px" class="LabelRight12px TDLabelBackground">
                                                                        Description
                                                                    </td>
                                                                    <td class="TDTextBox">
                                                                        <asp:TextBox ID="txtDescription" SkinID="TextBox12px" runat="server" MaxLength="200"
                                                                            TabIndex="11"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID="rfvDescription" ControlToValidate="txtDescription"
                                                                            runat="server">*</asp:RequiredFieldValidator>
                                                                        <cc1:ValidatorCalloutExtender ID="vceDescripion" runat="server" TargetControlID="rfvDescription">
                                                                        </cc1:ValidatorCalloutExtender>
                                                                        <cc1:FilteredTextBoxExtender ID="fteDescription" runat="server" TargetControlID="txtDescription" SkinID="filterText">
                                                                        </cc1:FilteredTextBoxExtender>
                                                                    </td>
                                                                </tr>
                                                                <tr style="padding-left: 10px">
                                                                    <td style="padding-left: 5px" class="LabelRight12px TDLabelBackground">
                                                                        Login
                                                                    </td>
                                                                    <td class="TDTextBox">
                                                                        <asp:TextBox ID="txtLogin" runat="server" SkinID="TextBox12px" MaxLength="6" TabIndex="12"
                                                                            TextMode="SingleLine" onblur="CheckLogin();"></asp:TextBox>
                                                                        
                                                                        <asp:HiddenField ID="hdfValidateLogin" runat="server" Value="0" />
                                                                        <asp:Label ID="lblValidateLogin" runat="server" Text="" SkinID="LabelError"></asp:Label>
                                                                        
                                                                        <cc1:FilteredTextBoxExtender ID="filterLogin" runat="server" SkinID="filterAlphanumeric"
                                                                            TargetControlID="txtLogin">
                                                                        </cc1:FilteredTextBoxExtender>
                                                                        <asp:RequiredFieldValidator ID="rfvLogin" ControlToValidate="txtLogin" runat="server">*</asp:RequiredFieldValidator>
                                                                        <cc1:ValidatorCalloutExtender ID="vceLogin" runat="server" TargetControlID="rfvLogin">
                                                                        </cc1:ValidatorCalloutExtender>
                                                                    </td>
                                                                </tr>
                                                                <tr style="padding-left: 10px">
                                                                    <td class="LabelRight12px TDLabelBackground" style="padding-left: 5px">
                                                                        Role
                                                                    </td>
                                                                    <td class="TDTextBox">
                                                                        <asp:DropDownList ID="ddlRole" runat="server" SkinID="ddl12px" TabIndex="14">
                                                                        </asp:DropDownList>
                                                                        <asp:RequiredFieldValidator ID="rfvRole" runat="server" ControlToValidate="ddlRole"
                                                                            Display="Dynamic">*</asp:RequiredFieldValidator>
                                                                        <cc1:ValidatorCalloutExtender ID="vceRole" runat="server" TargetControlID="rfvRole">
                                                                        </cc1:ValidatorCalloutExtender>
                                                                    </td>
                                                                </tr>
                                                                <tr style="padding-left: 10px">
                                                                    <td class="LabelRight12px TDLabelBackground" style="padding-left: 5px">
                                                                        Status
                                                                    </td>
                                                                    <td class="TDTextBox" style="font-family:Verdana; font-size:13px">
                                                                        <asp:RadioButtonList ID="optOptions" runat="server" TabIndex="15">
                                                                            <asp:ListItem Selected="True" Value="True">Active</asp:ListItem>
                                                                            <asp:ListItem Value="False">Inactive</asp:ListItem>
                                                                        </asp:RadioButtonList>
                                                                        <asp:RequiredFieldValidator ID="rfvStatus" runat="server" ControlToValidate="optOptions"
                                                                            Display="Dynamic">*</asp:RequiredFieldValidator>
                                                                        <cc1:ValidatorCalloutExtender ID="vceOptions" runat="server" TargetControlID="rfvStatus">
                                                                        </cc1:ValidatorCalloutExtender>
                                                                    </td>
                                                                </tr>
                                                                  <tr style="padding-left: 10px">
                                                                    <td class="LabelRight12px TDLabelBackground" style="padding-left: 5px">
                                                                         <asp:Label ID="Password" runat="server" Text="Password" Visible="false"></asp:Label>
                                                                    </td>
                                                                    <td class="TDTextBox">
                                                                        <asp:ImageButton ID="btnReset" runat="server" 
                                                                            ImageUrl="~/App_Themes/Theme/Images/Botones/Botones Reducidos/Ingles/Reset_Button copy.gif" 
                                                                            onclick="btnReset_Click" Visible="False" />
                                                                    </td>
                                                                </tr>
                                                                <tr style="padding-left: 10px">
                                                                    <td class="LabelRight12px TDLabelBackground" style="padding-left: 5px">
                                                                        &nbsp;
                                                                    </td>
                                                                    <td class="TDTextBox">
                                                                        &nbsp;
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td id="BotonesEdit" style="vertical-align: middle; width:100%;" align="right" colspan="3">
                                                            <asp:ImageButton ID="btnSave" runat="server" ImageUrl="~/App_Themes/Theme/Images/Botones/Botones Reducidos/Ingles/b_Save.jpg"
                                                                OnClick="btnSave_Click" />
                                                            <asp:ImageButton ID="btnNew" runat="server" CausesValidation="true" ImageUrl="~/App_Themes/Theme/Images/Botones/Botones Reducidos/Ingles/b_New.jpg"
                                                                OnClick="btnNew_Click" TabIndex="17" />
                                                            <asp:ImageButton ID="btnCancel" runat="server" ImageUrl="~/App_Themes/Theme/Images/Botones/Botones Reducidos/Ingles/b_Cancel.gif"
                                                                OnClick="btnCancel_Click" TabIndex="18" CausesValidation="false" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </asp:Panel>
                                            <cc1:CollapsiblePanelExtender ID="pnlEdit_Collapse" runat="server" TargetControlID="pnlEdit"
                                                BehaviorID="pnlDetailsExtender" CollapsedImage="~/App_Themes/Theme/Images/Images IE6/Plus.gif"
                                                ExpandedImage="~/App_Themes/Theme/Images/Images IE6/Minus.gif" CollapseControlID="imgCollapseEdit"
                                                ExpandControlID="imgCollapseEdit" Collapsed="true" SuppressPostBack="false" ImageControlID="imgCollapseEdit">
                                            </cc1:CollapsiblePanelExtender>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                </td>
                            </tr>
                            <tr>
                                <td class="TDSeparadorV" colspan="2">
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align: left" colspan="2">
                                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                        <ContentTemplate>
                                            <asp:GridView ID="grvUsers" runat="server" SkinID="GridGMAC" AutoGenerateColumns="False"
                                                Width="100%" OnRowDataBound="grvUsers_RowDataBound" DataKeyNames="UserID">
                                                <Columns>
                                                    <asp:BoundField HeaderText="User Name" DataField="FullName" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                                    <asp:BoundField HeaderText="Login" DataField="Login" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                                    <asp:BoundField HeaderText="Departmet" DataField="Department" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                                    <asp:BoundField HeaderText="Email" DataField="Email" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                                    <asp:TemplateField HeaderText="Role" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                                        <ItemTemplate>
                                                            <asp:HiddenField ID="hdRoleId" runat="server" Value='<%# Eval("Role.RoleID") %>' />
                                                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("Role.Name") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField HeaderText="Status" DataField="Status" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                                    <ItemTemplate>
                                                        <asp:HiddenField ID="hfStatus" runat="server" Value='<%# Eval("Status") %>' />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                </Columns>
                                                <HeaderStyle HorizontalAlign="Center" />
                                            </asp:GridView>
                                            <fwm:PagingControl ID="PagingControl" runat="server" 
                                                AllowPageSizeChange="false" OnPageChanged="pagingControl_PageChanged" 
                                                ShowCurrentRecordsLegend="false"  />
                                        </ContentTemplate>
                                        <Triggers>
                                            <asp:AsyncPostBackTrigger ControlID="grvUsers" EventName="SelectedIndexChanged" />
                                            <asp:AsyncPostBackTrigger ControlID="imgBuscarReg" EventName="Click" />
                                        </Triggers>
                                    </asp:UpdatePanel>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align: right;">
                                    <asp:UpdatePanel ID="upMessageConfirm" runat="server" UpdateMode="Conditional">
                                        <ContentTemplate>
                                            <asp:ImageButton ID="btnModify" runat="server" ImageUrl="~/App_Themes/Theme/Images/Botones/Botones Reducidos/Ingles/b_Modify.jpg"
                                                OnClick="btnModify_Click" OnClientClick="ExpandPanel();" CausesValidation="false"
                                                TabIndex="20" />
                                            <asp:ImageButton ID="btnDelete" runat="server" ImageUrl="~/App_Themes/Theme/Images/Botones/Botones Reducidos/Ingles/b_Delete.jpg"
                                                CausesValidation="false" TabIndex="21" OnClick="btnDelete_Click" />
                                            <%--<cc1:ConfirmButtonExtender ID="confirmExtender" runat="server" DisplayModalPopupID="popupExtenderConfirm"
                                                TargetControlID="btnDelete">
                                            </cc1:ConfirmButtonExtender>--%>
                                            <asp:Panel ID="pnlMessageConfirm" runat="server" CssClass="modalPopup" Height="140px"
                                                Style="display: none;" Width="400px">
                                                <table width="100%">
                                                    <tr style="height: 100px">
                                                        <td style="height: 100%;" align="center">
                                                            <uc1:wucMessage ID="wucMessageConfirm" runat="server" MessageType="Information" Message="Are you sure you want to delete the selected user?"
                                                                Visible="true" />
                                                        </td>
                                                    </tr>
                                                    <tr style="vertical-align: bottom">
                                                        <td align="center">
                                                            <asp:ImageButton ID="btnConfirm" runat="server" ImageUrl="~/App_Themes/Theme/Images/Botones/Botones Reducidos/Ingles/b_Accept.jpg"
                                                                CausesValidation="false" OnClick="btnConfirm_Click" />
                                                            <asp:ImageButton ID="btnCancelConfirm" runat="server" ImageUrl="~/App_Themes/Theme/Images/Botones/Botones Reducidos/Ingles/b_Cancel.gif"
                                                                CausesValidation="false" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </asp:Panel>
                                            <cc1:ModalPopupExtender ID="popupExtenderConfirm" runat="server" BackgroundCssClass="modalBackground"
                                                DropShadow="false" PopupControlID="pnlMessageConfirm" TargetControlID="lnkConfirm"
                                                CancelControlID="btnCancelConfirm">
                                            </cc1:ModalPopupExtender>
                                            <asp:LinkButton ID="lnkConfirm" runat="server"></asp:LinkButton>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <asp:UpdatePanel ID="upMessage" runat="server">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
        </Triggers>
        <ContentTemplate>
            <asp:Panel ID="pnlMessage" runat="server" CssClass="modalPopup" Height="140px" Style="display: none;"
                Width="400px">
                <table width="100%">
                    <tr style="height: 100px">
                        <td style="height: 100%" align="center">
                            <uc1:wucMessage ID="wucMessage" runat="server" />
                        </td>
                    </tr>
                    <tr style="vertical-align: bottom">
                        <td align="center">
                            <asp:ImageButton ID="btnAccept" runat="server" ImageUrl="~/App_Themes/Theme/Images/Botones/Botones Reducidos/Ingles/b_Accept.jpg"
                                CausesValidation="false" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <cc1:ModalPopupExtender ID="popupExtenderMessage" runat="server" BackgroundCssClass="modalBackground"
                DropShadow="false" PopupControlID="pnlMessage" TargetControlID="lnkPopupMessage"
                CancelControlID="btnAccept">
            </cc1:ModalPopupExtender>
            <asp:LinkButton ID="lnkPopupMessage" runat="server"></asp:LinkButton>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>
